package ProjetCorba;

/**
 * Interface definition : GestionLivraison
 * 
 * @author OpenORB Compiler
 */
public class _GestionLivraisonStub extends org.omg.CORBA.portable.ObjectImpl
        implements GestionLivraison
{
    static final String[] _ids_list =
    {
        "IDL:ProjetCorba/GestionLivraison:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = ProjetCorba.GestionLivraisonOperations.class;

    /**
     * Operation creerColis
     */
    public String creerColis(short staD, short staA, short idAdhD, short idAdhA, short idCas)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("creerColis",true);
                    _output.write_short(staD);
                    _output.write_short(staA);
                    _output.write_short(idAdhD);
                    _output.write_short(idAdhA);
                    _output.write_short(idCas);
                    _input = this._invoke(_output);
                    String _arg_ret = _input.read_string();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("creerColis",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.GestionLivraisonOperations _self = (ProjetCorba.GestionLivraisonOperations) _so.servant;
                try
                {
                    return _self.creerColis( staD,  staA,  idAdhD,  idAdhA,  idCas);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation depotColisPourTransport
     */
    public void depotColisPourTransport(short idCol)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("depotColisPourTransport",true);
                    _output.write_short(idCol);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("depotColisPourTransport",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.GestionLivraisonOperations _self = (ProjetCorba.GestionLivraisonOperations) _so.servant;
                try
                {
                    _self.depotColisPourTransport( idCol);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation depotColisPourRetrait
     */
    public void depotColisPourRetrait(short idCol)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("depotColisPourRetrait",true);
                    _output.write_short(idCol);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("depotColisPourRetrait",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.GestionLivraisonOperations _self = (ProjetCorba.GestionLivraisonOperations) _so.servant;
                try
                {
                    _self.depotColisPourRetrait( idCol);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation retraitColisPourTransport
     */
    public void retraitColisPourTransport(short idCol)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("retraitColisPourTransport",true);
                    _output.write_short(idCol);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("retraitColisPourTransport",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.GestionLivraisonOperations _self = (ProjetCorba.GestionLivraisonOperations) _so.servant;
                try
                {
                    _self.retraitColisPourTransport( idCol);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation retraitColis
     */
    public void retraitColis(short idCol)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("retraitColis",true);
                    _output.write_short(idCol);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("retraitColis",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.GestionLivraisonOperations _self = (ProjetCorba.GestionLivraisonOperations) _so.servant;
                try
                {
                    _self.retraitColis( idCol);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getStatusColis
     */
    public String getStatusColis(short idCol)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getStatusColis",true);
                    _output.write_short(idCol);
                    _input = this._invoke(_output);
                    String _arg_ret = _input.read_string();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getStatusColis",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.GestionLivraisonOperations _self = (ProjetCorba.GestionLivraisonOperations) _so.servant;
                try
                {
                    return _self.getStatusColis( idCol);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
